package com.good.test;

public class ThreadDemo implements Runnable {

	@Override
	public void run() {
		for (int i = 0; i < 10; i++) {
			try {
				Thread.sleep(1000);
			} catch (InterruptedException e) {
				System.out.println("打断");
				
				e.printStackTrace();
				return;
			}
			System.out.println(Thread.currentThread().getName()+"===="+i);
		}

	}

	public static void main(String[] args) {
		ThreadDemo thdemo=new ThreadDemo();
		Thread thread = new Thread(thdemo,"1hao");
		thread.start();
		thread.interrupt();
		System.out.println("end");
	}

}
